﻿using maERP.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace maERP.Persistence.Configurations;

public class CountryConfiguration : IEntityTypeConfiguration<Country>
{
    public void Configure(EntityTypeBuilder<Country> modelBuilder)
    {
        modelBuilder.HasData(
            new Country { Id = 1, CountryCode = "DE", Name = "Germany" },
            new Country { Id = 2, CountryCode = "AT", Name = "Austria" },
            new Country { Id = 3, CountryCode = "CH", Name = "Switzerland" },
            new Country { Id = 4, CountryCode = "AD", Name = "Andorra" },
            new Country { Id = 5, CountryCode = "AF", Name = "Afghanistan" },
            new Country { Id = 6, CountryCode = "AG", Name = "Antigua and Barbuda" },
            new Country { Id = 7, CountryCode = "AL", Name = "Albania" },
            new Country { Id = 8, CountryCode = "AM", Name = "Armenia" },
            new Country { Id = 9, CountryCode = "AO", Name = "Angola" },
            new Country { Id = 10, CountryCode = "AX", Name = "Åland Islands" },
            new Country { Id = 11, CountryCode = "AR", Name = "Argentina" },
            new Country { Id = 12, CountryCode = "AT", Name = "Antarctica" },
            new Country { Id = 13, CountryCode = "AU", Name = "Australia" },
            new Country { Id = 14, CountryCode = "AZ", Name = "Azerbaijan" },
            new Country { Id = 15, CountryCode = "BA", Name = "Bosnia and Herzegovina" },
            new Country { Id = 16, CountryCode = "BB", Name = "Barbados" },
            new Country { Id = 17, CountryCode = "BE", Name = "Belgium" },
            new Country { Id = 18, CountryCode = "BG", Name = "Bulgaria" },
            new Country { Id = 19, CountryCode = "BL", Name = "Saint Barthélemy" },
            new Country { Id = 20, CountryCode = "BO", Name = "Bolivia" },
            new Country { Id = 21, CountryCode = "BR", Name = "Brazil" },
            new Country { Id = 22, CountryCode = "BS", Name = "Bahamas" },
            new Country { Id = 23, CountryCode = "BY", Name = "Belarus" },
            new Country { Id = 24, CountryCode = "BZ", Name = "Belize" },
            new Country { Id = 25, CountryCode = "CA", Name = "Canada" },
            new Country { Id = 26, CountryCode = "CH", Name = "Cocos (Keeling) Islands" },
            new Country { Id = 27, CountryCode = "CI", Name = "Ivory Coast" },
            new Country { Id = 28, CountryCode = "CL", Name = "Chile" },
            new Country { Id = 29, CountryCode = "CN", Name = "China" },
            new Country { Id = 30, CountryCode = "CO", Name = "Colombia" },
            new Country { Id = 31, CountryCode = "CR", Name = "Costa Rica" },
            new Country { Id = 32, CountryCode = "CU", Name = "Cuba" },
            new Country { Id = 33, CountryCode = "CY", Name = "Cyprus" },
            new Country { Id = 34, CountryCode = "CZ", Name = "Czech Republic" },
            new Country { Id = 35, CountryCode = "DO", Name = "Dominican Republic" },
            new Country { Id = 36, CountryCode = "DK", Name = "Denmark" },
            new Country { Id = 37, CountryCode = "DZ", Name = "Algeria" },
            new Country { Id = 38, CountryCode = "EC", Name = "Ecuador" },
            new Country { Id = 39, CountryCode = "EE", Name = "Estonia" },
            new Country { Id = 40, CountryCode = "EG", Name = "Egypt" },
            new Country { Id = 41, CountryCode = "ER", Name = "Eritrea" },
            new Country { Id = 42, CountryCode = "ES", Name = "Spain" },
            new Country { Id = 43, CountryCode = "ET", Name = "Ethiopia" },
            new Country { Id = 44, CountryCode = "FI", Name = "Finland" },
            new Country { Id = 45, CountryCode = "FR", Name = "France" },
            new Country { Id = 46, CountryCode = "GB", Name = "United Kingdom" },
            new Country { Id = 47, CountryCode = "GE", Name = "Georgia" },
            new Country { Id = 48, CountryCode = "GF", Name = "French Guiana" },
            new Country { Id = 49, CountryCode = "GH", Name = "Ghana" },
            new Country { Id = 50, CountryCode = "GL", Name = "Greenland" },
            new Country { Id = 51, CountryCode = "GP", Name = "Guadeloupe" },
            new Country { Id = 52, CountryCode = "GR", Name = "Greece" },
            new Country { Id = 53, CountryCode = "GT", Name = "Guatemala" },
            new Country { Id = 54, CountryCode = "GY", Name = "Guyana" },
            new Country { Id = 55, CountryCode = "HN", Name = "Honduras" },
            new Country { Id = 56, CountryCode = "HR", Name = "Croatia" },
            new Country { Id = 57, CountryCode = "HT", Name = "Haiti" },
            new Country { Id = 58, CountryCode = "HU", Name = "Hungary" },
            new Country { Id = 59, CountryCode = "ID", Name = "Indonesia" },
            new Country { Id = 60, CountryCode = "IE", Name = "Ireland" },
            new Country { Id = 61, CountryCode = "IN", Name = "India" },
            new Country { Id = 62, CountryCode = "IR", Name = "Iran" },
            new Country { Id = 63, CountryCode = "IS", Name = "Iceland" },
            new Country { Id = 64, CountryCode = "IT", Name = "Italy" },
            new Country { Id = 65, CountryCode = "JM", Name = "Jamaica" },
            new Country { Id = 66, CountryCode = "JP", Name = "Japan" },
            new Country { Id = 67, CountryCode = "KE", Name = "Kenya" },
            new Country { Id = 68, CountryCode = "KG", Name = "Kyrgyzstan" },
            new Country { Id = 69, CountryCode = "KR", Name = "South Korea" },
            new Country { Id = 70, CountryCode = "KW", Name = "Kuwait" },
            new Country { Id = 71, CountryCode = "KZ", Name = "Kazakhstan" },
            new Country { Id = 72, CountryCode = "LU", Name = "Luxembourg" },
            new Country { Id = 73, CountryCode = "LT", Name = "Lithuania" },
            new Country { Id = 74, CountryCode = "LV", Name = "Latvia" },
            new Country { Id = 75, CountryCode = "MA", Name = "Morocco" },
            new Country { Id = 76, CountryCode = "MC", Name = "Monaco" },
            new Country { Id = 77, CountryCode = "MD", Name = "Moldova", },
            new Country { Id = 78, CountryCode = "MF", Name = "Saint Martin" },
            new Country { Id = 79, CountryCode = "MG", Name = "Madagascar" },
            new Country { Id = 80, CountryCode = "MQ", Name = "Martinique" },
            new Country { Id = 81, CountryCode = "MT", Name = "Malta" },
            new Country { Id = 82, CountryCode = "MX", Name = "Mexico" },
            new Country { Id = 83, CountryCode = "MY", Name = "Malaysia" },
            new Country { Id = 84, CountryCode = "NG", Name = "Nigeria" },
            new Country { Id = 85, CountryCode = "NI", Name = "Nicaragua" },
            new Country { Id = 86, CountryCode = "NL", Name = "Netherlands" },
            new Country { Id = 87, CountryCode = "NO", Name = "Norway" },
            new Country { Id = 88, CountryCode = "NZ", Name = "New Zealand" },
            new Country { Id = 89, CountryCode = "OM", Name = "Oman" },
            new Country { Id = 90, CountryCode = "PA", Name = "Panama" },
            new Country { Id = 91, CountryCode = "PE", Name = "Peru" },
            new Country { Id = 92, CountryCode = "PL", Name = "Poland" },
            new Country { Id = 93, CountryCode = "PM", Name = "Saint Pierre and Miquelon" },
            new Country { Id = 94, CountryCode = "PR", Name = "Puerto Rico" },
            new Country { Id = 95, CountryCode = "PT", Name = "Portugal" },
            new Country { Id = 96, CountryCode = "PY", Name = "Paraguay" },
            new Country { Id = 97, CountryCode = "QA", Name = "Qatar" },
            new Country { Id = 98, CountryCode = "RO", Name = "Romania" },
            new Country { Id = 99, CountryCode = "RS", Name = "Serbia" },
            new Country { Id = 100, CountryCode = "RU", Name = "Russia" },
            new Country { Id = 101, CountryCode = "SA", Name = "Saudi Arabia" },
            new Country { Id = 102, CountryCode = "SE", Name = "Sweden" },
            new Country { Id = 103, CountryCode = "SG", Name = "Singapore" },
            new Country { Id = 104, CountryCode = "SI", Name = "Slovenia" },
            new Country { Id = 105, CountryCode = "SK", Name = "Slovakia" },
            new Country { Id = 106, CountryCode = "SN", Name = "Senegal" },
            new Country { Id = 107, CountryCode = "SR", Name = "Suriname" },
            new Country { Id = 108, CountryCode = "SV", Name = "El Salvador" },
            new Country { Id = 109, CountryCode = "TR", Name = "Turkey" },
            new Country { Id = 110, CountryCode = "TT", Name = "Trinidad and Tobago" },
            new Country { Id = 111, CountryCode = "UA", Name = "Ukraine" },
            new Country { Id = 112, CountryCode = "US", Name = "United States" },
            new Country { Id = 113, CountryCode = "UY", Name = "Uruguay" },
            new Country { Id = 114, CountryCode = "VE", Name = "Venezuela" },
            new Country { Id = 115, CountryCode = "VI", Name = "Virgin Islands" },
            new Country { Id = 116, CountryCode = "VN", Name = "Vietnam" },
            new Country { Id = 117, CountryCode = "YE", Name = "Yemen" },
            new Country { Id = 118, CountryCode = "ZA", Name = "South Africa" },
            new Country { Id = 119, CountryCode = "ZM", Name = "Zambia" },
            new Country { Id = 120, CountryCode = "ZW", Name = "Zimbabwe" }
        );

        modelBuilder.Property(q => q.Name)
            .IsRequired()
            .HasMaxLength(100);
    }
}
